1. Field of the Invention
The present invention relates to an electronic control unit (for example, an in-vehicle microcomputer) including flash memory as a ready-only memory (ROM) and method and apparatus for storing a control data group including control data specific to a control for a controlled system of the electronic control unit into the same flash memory.
2. Description of the Related Art
In general, in an automotive vehicle, such a microcomputer as described above has been used to control an engine and a drive train including an automatic transmission. Control data for the control of the controlled system are stored in a nonvolatile memory (read-only memory, i.e., ROM) in order to prevent he stored control data from being erased even if an electric power is turned off (a battery is disconnected from a power line of the microcomputer). A rewrite of the contents of the control data in the microcomputer is demanded at a stage of vehicle development or at a marketplace (viz., car dealer) in a case where the control contents in the microcomputer is needed to be altered.
Therefore, a rewritable nonvolatile memory is used in the in-vehicle microcomputer and an external memory rewritable device (an off-board (or an out-vehicle) electronic diagnosing tester such as a Consult) is connected to the in-vehicle microcomputer via communication medium and device to rewrite the contents of the rewritable nonvolatile memory. The writable nonvolatile memory includes an EEPROM (Electrically Erasable Programmable Read-Only Memory); and a flash memory (FLASH EEPROM).
The EEPROM is extremely expensive and its internal circuit structure is complex although the EEPROM can be erased and rewritten in a unit of one word (two bytes) and number of times the rewriting can be guaranteed is as many as one million number of times or more.
On the other hand, the flash memory (FLASH EEPROM) is inexpensive. However, although the flash memory can be written in the unit of one byte, it is necessary to perform an erasure of the contents thereof in a case of the rewrite in the unit of one block (for example, 2 kilobytes or 4 kilobytes). The number of times the rewrite can be guaranteed reach to approximately one hundred number of times.
To cope with such an inconvenience as described above, in a technique disclosed in a U.S. Pat. No. 6,046,937 to Komori et al, issued on Apr. 4, 2000 (which corresponds to a Japanese Patent Application First Publication No. Heisei 2000-45858 published on Feb. 15, 2000), a count information storage region for retaining the write count of the flash memory is set up at a plurality of consecutive addresses in the flash memory, each time rewriting process is carried out by a CPU of the microcomputer for the flash memory, data-unwritten address in the count information storage region is selected in ascending order of addresses starting from the top address thereof, and numeric value data representing a rewrite count of the flash memory is written to the address thus selected in order for the number of times the rewrite processes of the flash memory to be easily determined and to be accurately determined even if such a bit garbling that any bit data is erroneously changed from xe2x80x9c0xe2x80x9d to xe2x80x9c1xe2x80x9d or vice versa occurs.
Both of the flash memory and the EEPROM have previously been installed in the in-vehicle microcomputer and have been shared in use for different purposes according to respective features of the flash memory and EEPROM with the above-described inherent characteristics of these nonvolatile read-only memories in mind.
That is to say, programs and a calibration verification value to diagnose ROM (CVN) allocated to the flash memory. In addition, various kinds of adjustment values (an idling speed adjustment value, ignition timing adjustment value, and so forth), freeze frame data (FFD) to store and retain drive data before and after a failure occurrence, and so forth are allocated to the EEPROM which is easy to update the contents thereof.
However, in spite of the fact that each of the EEPROM and the flash memory is electrically rewritable, both read-only memories have previously been installed in the in-vehicle microcomputer so that a system cost of the microcomputer accordingly becomes high.
Our inventors have discussed an abolishment of the installation of the expensive EEPROM and a possibility of a single use of the flash memory only as the ROM of the in-vehicle microcomputer.
As a result of the discussion, our inventors have reached to such a conclusion as described below. That is to say, from among the data previously allocated to the EEPROM, it is possible to move the freeze frame data (FFD) into a back-up RAM and the remaining data (idling speed adjustment value, ignition timing adjustment value, immobilizer encryption key, and so forth) can be allocated to the flash memory if a method of writing (or a method of updating) is devised.
It is, with the above-described conclusion in mind, an object of the present invention to provide an inexpensive electronic control unit including a flash memory (FLASH EEPROM) as a rewritable nonvolatile read-only memory and method and apparatus for storing the control data in the flash memory of the electronic control unit which can achieve a storage of specific control data group including at least one control data requiring rewrite of contents thereof into the flash memory.
According to one aspect of the present invention, there is provided with a method for storing a control data group, the control data group including control data specific to a control for a controlled system, into a flash memory (3) used for a read-only memory of an electronic control unit (1), the method comprising:providing (FIG. 2) a predetermined memory block of the flash memory for a storage of the control data group, the control data group including at least one control data requiring an update of contents thereof and at least one updated control data; and allocating (FIG. 2) a plurality of storage regions (A1 through A16) to the predetermined memory block of the flash memory in an order of addresses in such a manner that each storage region has a capacity enough for the control data group to be written thereinto, the control data group including the control data requiring the update of the contents thereof is written into one of the storage regions which is data-unwritten and whose address is top in the order of addresses, and at least the updated control data is written into one of the remaining storage regions which is data-unwritten and whose address is top in the order of addresses from among the remaining data-unwritten storage regions each time an update request to update the contents of the control data occurs.
According to another aspect of the present invention, there is provided with A method for storing a control data group, the control data group including control data specific to a control for a controlled system, into a flash memory (3) used for a read-only memory of an electronic control unit (1), the method comprising: allocating (FIG. 2) a plurality of storage regions (A1 through A16), each of the storage regions having a capacity enough for the control data group including at least one control data requiring an update of contents thereof and at least one updated control data to be written thereinto, to the predetermined memory block of the flash memory in an order of addresses; writing (FIG. 2) the control data group including the one control data requiring the update of the contents thereof into one of the storage regions which is date-unwritten and whose address is top in the order of addresses; and writing (FIG. 3B, FIG. 4B) at least the updated control data into one of the remaining storage regions which is data-unwritten and whose address is top in the order of addresses from among the remaining data-unwritten storage regions each time an update request to update the content of thereof occurs.
According to a still another aspect of the present invention, there is provided with an apparatus for storing a control data group, the control data group including control data specific to a control for a controlled system, into a flash memory (3) used for a read-only memory of an electronic control unit (1), the apparatus comprising: storage region allocating section (FIG. 2) that allocates a plurality of storage regions (A1 through A16), each of the storage regions having a capacity enough for the control data group including at least one control data requiring an update of contents thereof and at least one updated control data to be written thereinto, to the predetermined memory block of the flash memory in an order of addresses; a control data group writing section (1, FIG. 2) that writes the control data group including the control data requiring the update of contents thereof into the one of the storage regions which is date-unwritten and whose address is top in the order of addresses; and an updated data write processing section (1, FIG. 3B, FIG. 4B) that writes at least the updated control data into one of the storage regions which is data-unwritten and whose address is top in the order of addresses from among the remaining data-unwritten storage regions each time the update request occurs.
According to a further aspect of the present invention, there is provided with An electronic control unit comprising: a flash memory (3) having a predetermined memory block to which a plurality of storage regions (A1 through A16) are allocated in an order of addresses, each of the storage regions having a capacity enough for a control data group including control data specific to a control for a controlled system to be written and the control data group including at least one control data requiring an update of contents thereof being written into one of the storage regions which is data-unwritten and whose address is top in the order of addresses; a first determinator (S7 in FIG. 5) to determine whether an update request to update the contents of the control data requiring the update is issued from a memory write device external to the electronic control unit; and an updated control data writing processor (1) to write at least the updated control data into one of the remaining storage regions which is data-unwritten and whose address is top in the order of addresses from among the remaining data-unwritten storage regions each time the determinator determines that the update request is issued.
This summary of the invention does not necessarily describe all necessary features so that the invention may also be a sub-combination of these described features.